<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title><spring:message code="common.welcome"/></title>
	<meta name="decorator" content="default"/>
    <style>
        .form-horizontal .control-label{  float: left;  font-size: 16px;  }
        .form-horizontal .controls{  padding-top: 3px;  width:160px;  margin-left: 10px;  overflow-x: hidden;  float: left;  font-size: 16px;  }
        .quick_area{max-width: 700px;position: absolute;right: 0;top: 50px;}
        .quick_area>div{float: right;}
        .refresh_area{width: 100px;padding-top: 5px;}
        .power_area{width: 600px;}
        .nav-pills{float: right;}
        .nav-pills>li>a{cursor: pointer;padding-top: 0;padding-bottom: 0;}
        .nav-pills>li>a>span{font-size: 16px!important;color: red!important;margin: 0 3px;}

        .quick_url_area{padding-top: 200px;width: 400px;}
        .nav-tabs.nav-stacked>ul{width: 200px;}
        .nav-tabs.nav-stacked>li>a{border: none;cursor: pointer; font-size: 16px;}
        .nav-tabs.nav-stacked>li>a>i{margin:0 10px 0 0;}
    </style>
</head>
<body >
<div  >
    <div style="width: 30%;float: left">
        <div style="border: 1px solid #c4c4c4;border-radius: 4px">
            <label style="display: block;margin-top: 20px;margin-left: 20px;font-size: 20px;/*font-weight: 500;*/"><spring:message code="common.welcomeyou"/></label>
            <form:form id="inputForm" modelAttribute="user" method="post" class="form-horizontal" cssStyle="margin-top: 30px;margin-left: 50px;">
                <div class="control-group">
                    <%--<label class="control-label"><spring:message code="common.name"/>:</label>--%>

                    <div class="controls" style="width: inherit;margin-left: 0;">
                        <i class="icon-user" ></i>
                            ${user.name}
                    </div>
                </div>
                <div class="control-group">
                   <%-- <label class="control-label"><spring:message code="common.phone_number"/>:</label>--%>

                    <div class="controls" style="width: inherit;margin-left: 0;">
                        <i class="icon-mobile-phone"  style="    font-size: 21px;"></i>
                            ${user.mobile}
                    </div>
                </div>
                <div class="control-group">
                   <%-- <label class="control-label"><spring:message code="common.authority"/>:</label>--%>

                    <div class="controls" style="width: inherit;margin-left: 0;">
                        <i class="icon-group" ></i>
                    		<c:if test="${language == 'zh'}">
                            ${user.roleNames}
                            </c:if>
                              <c:if test="${language == 'en'}">
                               ${user.role.enname}
                            </c:if>
                    </div>
                </div>
                <c:if test="${user.userType != 1 }">
                    <div class="control-group" style="margin-bottom: 0 !important;">
                       <%-- <label class="control-label"><spring:message code="common.expirydate"/>:</label>--%>

                        <div class="controls"  style="width: inherit;margin-left: 0;">
                            <i class="icon-calendar"></i>
                            <fmt:formatDate value="${user.avaliDate}" pattern="yyyy-MM-dd"/>
                        </div>
                    </div>
                </c:if>
                <div class="control-group">
                <c:if test="${user.role.dataScope >=4}">

                      <%--  <label class="control-label"><spring:message code="Superior.maintenance.personnel"/>:</label>--%>
                        <div class="controls" style="clear: both;width:100%;margin-left: 0;line-height:40px;border-bottom: 1px dotted #eee;">
                            <i class="icon-user" ></i>
                            <spring:message code="manager.group.last"/>:
                                ${operate.name}

                        </div>
                    <div class="controls" style="clear: both;width:100%;margin-left: 0;line-height:40px;border-bottom: 1px dotted #eee;">

                        <i class="icon-mobile-phone" style="    font-size: 21px;"></i>

                            ${operate.mobile}
                    </div>
                        <%--<label class="control-label"><spring:message code="common.phone_number"/>:</label>--%>



                </c:if>

                <c:if test="${user.role.dataScope >=3}">

                      <%--  <label class="control-label"></label>--%>
                        <div class="controls"  style="clear: both;width:100%;margin-left: 0;line-height: 40px;border-bottom: 1px dotted #eee;">
                            <i class="icon-user" ></i>
                            <spring:message code="Senior.district.administrator"/>:
                                ${checkUser.name}

                        </div>
                    <div class="controls"  style="clear: both;width:100%;margin-left: 0;line-height: 40px;border-bottom: 1px dotted #eee;">
                        <i class="icon-mobile-phone" style="    font-size: 21px;"></i>
                            ${checkUser.mobile}
                    </div>
                       <%-- <label class="control-label"><spring:message code="common.phone_number"/>:</label>
                        <div class="controls">
                                ${checkUser.mobile}
                        </div>--%>

                </c:if>
                <c:if test="${user.role.dataScope >=2}">

                      <%--  <label class="control-label"></label>--%>
                        <div class="controls"  style="clear: both;width:100%;margin-left: 0;line-height: 40px;border-bottom: 1px dotted #eee;">
                            <i class="icon-user" ></i>
                            <spring:message code="common.administrator"/>:
                                ${admin.name}
                        </div>
                    <div class="controls"  style="clear: both;width:100%;margin-left: 0;line-height: 40px;border-bottom: 1px dotted #eee;">
                        <i class="icon-mobile-phone" style="    font-size: 21px;"></i>
                            ${admin.mobile}
                    </div>
                        <%--<label class="control-label"><spring:message code="common.phone_number"/>:</label>
                        <div class="controls">
                                ${admin.mobile}
                        </div>--%>

                </c:if>
                </div>
            </form:form>

        </div>
        <div style="border: 1px solid #c4c4c4;border-radius: 4px;margin-top:30px">
            <div <%--class="quick_url_area"--%>>
                <ul class="nav nav-tabs nav-stacked">
                    <li>
                        <a href="${ctx}/source/eleSourceMultimedia/list"><i class="icon-arrow-right"></i><spring:message code="welcome.link.multimedia"/></a>
                    </li>
                    <li>
                        <a href="${ctx}/source/title/eleSourceTitle/list"><i class="icon-arrow-right"></i><spring:message code="welcome.link.title"/></a>
                    </li>
                    <li>
                        <a href="${ctx}/source/subtitle/eleSourceSubtitleGroup/list"><i class="icon-arrow-right"></i><spring:message code="welcome.link.subtitle"/></a>
                    </li>
                    <shiro:hasPermission name="templet:eleTemplet:edit">
                    <li>
                        <a href="${ctx}/templet/eleTemplet/list"><i class="icon-arrow-right"></i><spring:message code="welcome.link.template.list"/></a>
                    </li>
                    </shiro:hasPermission>
                </ul>
            </div>


        </div>
    </div>
    <div style="width: 65%;float: left;border: 1px solid #c4c4c4;border-radius: 4px;margin-left:20px">
        <button type="button" class="btn" style="margin: 15px;float: right" onclick="reloadPage();"><spring:message code="common.refresh"/></button>
       <shiro:hasPermission name="templet:eleTemplet:edit">
        <ul class="index-shebei">
            <shiro:hasPermission name="sys:user:check">
            <li>
                <a href="${ctx}/sys/user/mychecklist"><div style="font-size: 35px;color:#505050;text-align: center">${userApplys}</div>
                    <div style="margin-top: 30px;text-align: center"><i class="icon-circle" style="color: #863da6"></i><spring:message code="user.add.apply"/></div></a>
            </li>
            </shiro:hasPermission>
            <shiro:hasPermission name="equipment:eleEquipment:check">
            <li>
                <a href="${ctx}/equipment/eleEquipment/mychecklist"><div style="font-size: 35px;color:#505050;text-align: center">${deviceApplys}</div>
                    <div style="margin-top: 30px;text-align: center"><i class="icon-circle" style="color: #ffa526"></i><spring:message code="device.add.apply"/></div></a>
            </li>
            </shiro:hasPermission>
            <shiro:hasPermission name="templet:eleTemplet:check">
            <li>
                <a href="${ctx}/templet/eleTemplet/mychecklist"><div style="font-size: 35px;color:#505050;text-align: center">${templateApplys}</div>
                    <div style="margin-top: 30px;text-align: center"><i class="icon-circle" style="color: #9cff1c"></i><spring:message code="template.add.apply"/></div></a>
            </li>
            </shiro:hasPermission>
            <shiro:hasPermission name="source:eleSourceGroup:edit">
            <li>
                <a href="${ctx}/source/eleSourceGroup/approvelist"><div style="font-size: 35px;color:#505050;text-align: center">${groupApplys}</div>
                    <div style="margin-top: 30px;text-align: center"><i class="icon-circle" style="color: #ff3a3d"></i><spring:message code="program.add.apply"/></div></a>
            </li>
            </shiro:hasPermission>
           
        </ul>
         </shiro:hasPermission>
        <ul class="index-renyuan">
          <%--  <li><spring:message code="Your.permissions.include"/></li>--%>
            <li class="index-renyuan-li"><div>
                <c:if test="${user.role.dataScope !=4}">
                 <a href="${ctx}/equipment/eleEquipment/list">
                <spring:message code="welcome.permission.online.device"/>
                 </a>
                </c:if>
                <c:if test="${user.role.dataScope ==4}">
                    <spring:message code="welcome.permission.online.device"/>
                </c:if>
            </div>
                <div id="main" style="width: 150px;height:150px;"></div>
                <div style="float: left;margin-right: 20px">
                    <span style="display: block;line-height: 50px"><spring:message code="welcome.device.total"/>   ${equipments_all}<spring:message code="welcome.device.unit"/></span>
                    <span style="display: block;line-height: 50px"><spring:message code="welcome.device.online"/>   ${equipments}<spring:message code="welcome.device.unit"/></span>
                </div>
              <%--  <a href="${ctx}/sys/user/index"><span>${branches}</span>&lt;%&ndash;<spring:message code="user.count"/>&ndash;%&gt;</a>--%>
            </li>
           <%-- <li class="index-renyuan-li"><div>
                 <a href="${ctx}/equipment/eleEquipment/list">
                权限内的在线人员
                 </a>
            </div>
                <div id="main1" style="width: 150px;height:150px;"></div>
                <div style="float: left;margin-right: 20px">
                    <span style="display: block;line-height: 50px">共个</span>
                    <span style="display: block;line-height: 50px">在线${equipments}个</span>
                </div>
             &lt;%&ndash;   <a href="${ctx}/equipment/eleEquipment/list"><span>${equipments}</span><spring:message code="device.count"/></a>&ndash;%&gt;
            </li>--%>
        </ul>
    </div>
  <%--  <img src="${ctxStatic}/images/bg.png" style=" position: absolute; bottom: 0; z-index: -1; "/>--%>

  <%--  <div class="quick_area">
        <div class="refresh_area">
            <button type="button" class="btn"><spring:message code="common.refresh"/></button>
        </div>
        <div class="power_area">
            <ul class="nav nav-pills">
                <li><spring:message code="Your.permissions.include"/></li>
                <li>
                    <a href="${ctx}/sys/user/index"><span>${branches}</span><spring:message code="user.count"/></a>
                </li>
                <li>
                    <a href="${ctx}/equipment/eleEquipment/list"><span>${equipments}</span><spring:message code="device.count"/></a>
                </li>
            </ul>
            <ul class="nav nav-pills">
                <li>
                    <a href="${ctx}/sys/user/applylist"><span>${userApplys}</span><spring:message code="user.add.apply"/></a>
                </li>
                <li>
                    <a href="${ctx}/equipment/eleEquipment/applylist"><span>${deviceApplys}</span><spring:message code="device.add.apply"/></a>
                </li>
                <li>
                    <a href="${ctx}/templet/eleTemplet/applylist"><span>${templateApplys}</span><spring:message code="template.add.apply"/></a>
                </li>
                <li>
                    <a href="${ctx}/source/eleSourceGroup/approvelist"><span>${groupApplys}</span><spring:message code="program.add.apply"/></a>
                </li>
            </ul>
        </div>

    </div>--%>
    <script type="text/javascript">
        $(document).ready(function(){
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main'));

        var dataStyle = {
            normal: {
                label: {
                    show: false
                },
                labelLine: {
                    show: false
                },
                shadowBlur: 4,
                shadowColor: 'rgba(40, 40, 40, 0.5)',
            }
        };
        function reloadPage()
        {
        window.location.reload()
        }
        var placeHolderStyle = {
            normal: {
                color: '#bbb',//未完成的圆环的颜色
                label: {
                    show: false
                },
                labelLine: {
                    show: false
                }
            },
            emphasis: {
                color: '#eee'//未完成的圆环的颜色
            }
        };
        option = {
            title: {
                text: '${equipments}',
                x: 'center',
                y: 'center',
                textStyle: {
                    fontWeight: 'normal',
                    color: "#eb644b",
                    fontSize: 35
                }
            },
         /*   backgroundColor: '#011128',*/
            color: ['#eb644b', '#313443', '#fff'],
            tooltip: {
                show: false,
                formatter: "{a} <br/>{b} : {c} ({d})"
            },
            legend: {
                show: false,
                itemGap: 12,
                data: ['01', '02']
            },
            toolbox: {
                show: false,
                feature: {
                    mark: {
                        show: true
                    },
                    dataView: {
                        show: true,
                        readOnly: false
                    },
                    restore: {
                        show: true
                    },
                    saveAsImage: {
                        show: true
                    }
                }
            },
            series: [{
                name: 'Line 1',
                type: 'pie',
                clockWise: false,
                radius: [55, 60],
                itemStyle: dataStyle,
                hoverAnimation: false,

                data: [{
                    value: ${equipments},
                    name: '01'
                }, {
                    value: 25,
                    name: 'invisible',
                    itemStyle: placeHolderStyle
                }

                ]
            },




            ]
        };
        myChart.setOption(option);

     /*   // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main1'));

        var dataStyle = {
            normal: {
                label: {
                    show: false
                },
                labelLine: {
                    show: false
                },
                shadowBlur: 4,
                shadowColor: 'rgba(40, 40, 40, 0.5)',
            }
        };
        var placeHolderStyle = {
            normal: {
                color: '#bbb',//未完成的圆环的颜色
                label: {
                    show: false
                },
                labelLine: {
                    show: false
                }
            },
            emphasis: {
                color: '#eee'//未完成的圆环的颜色
            }
        };
        option = {
            title: {
                text: '${equipments}个',
                x: 'center',
                y: 'center',
                textStyle: {
                    fontWeight: 'normal',
                    color: "#83c32e",
                    fontSize: 35
                }
            },
            /!*   backgroundColor: '#011128',*!/
            color: ['#83c32e', '#313443', '#fff'],
            tooltip: {
                show: false,
                formatter: "{a} <br/>{b} : {c} ({d}个)"
            },
            legend: {
                show: false,
                itemGap: 12,
                data: ['01', '02']
            },
            toolbox: {
                show: false,
                feature: {
                    mark: {
                        show: true
                    },
                    dataView: {
                        show: true,
                        readOnly: false
                    },
                    restore: {
                        show: true
                    },
                    saveAsImage: {
                        show: true
                    }
                }
            },
            series: [{
                name: 'Line 1',
                type: 'pie',
                clockWise: false,
                radius: [55, 60],
                itemStyle: dataStyle,
                hoverAnimation: false,

                data: [{
                    value: ${equipments},
                    name: '01'
                }, {
                    value: 25,
                    name: 'invisible',
                    itemStyle: placeHolderStyle
                }

                ]
            },




            ]
        };
        myChart.setOption(option);*/
        })
    </script>
</div>
</body>
</html>